<?php
// +----------------------------------------------------------------------
// |===== Pyboon =====
// +----------------------------------------------------------------------
// | Copyright (c) 2016 Pyboon All rights reserved.
// +----------------------------------------------------------------------
// | Author: Baboon <Pyboon@foxmail.com>
// +----------------------------------------------------------------------
// | Date: 2016年1月26日 下午8:42:09
// +----------------------------------------------------------------------

namespace Home\Controller;

use Think\Controller;
use Com\Wechat\TPWechat;
use Think\Image;
/**
 * 空模块，主要用于显示404页面，请不要删除
 */
class TestController extends Controller{
	
    public function index(){
        header("Content-type: text/html; charset=utf-8");
      /*   $opt = array(
            'appid'=>"wx1aa5c8b0b8fc9537",
            'appsecret'=>"f2a4dcd925f988a2e5ee5ec154a6907d",
        );
       $openid = "oJVjJtxuKx5YRexrf1AqwCKiIzVs";
        $we = new TPWechat($opt);
        $wuserinfo = $we->getUserInfo($openid);
        dump($wuserinfo); */
        //dump($this->hiddenTel($tel));
       /*  $user = M("User")->field(array("openid", "count(uid)"=>"countCom","max(schoolCode)"=>"currentPrice"))->group('openid')->order("count(uid) desc")->select();
        dump($user);
        $sum = array();
        foreach ($user as $key => $value) {
          $sum[$value["openid"]] = $value;
          dump($value);
          //array_push($sum[$value["openid"]],$value);
          dump($sum);
        }
        dump($sum); */
        //APP_PATH
       /// qrcode("http://weixin.yzhihui.me/sdcenWX/index.php/Home/CheckIn/", "code.png");
        //Header("Content-type: image/png");
        /* vendor('MyImg','','.php');
        $img = new \MyImg(\Think\Image::IMAGE_IMAGICK);
        $path = "./Public/Img/";
        $img->open($path."code.png");
        //$img->crop(400, 400,100,30)->save('$path');
        //$codeimg = $img->createOilImg();
        echo $img->type(); */
       /* $score = A("Notice")->score();
       dump($score);
        $exam = A("Notice")->examArrange();
        dump($exam);
        $notice = A("Notice")->queryNotice();
        dump($notice);
        $exam = A("Notice")->examArrange();
        if(is_array($exam)){
            dump("array##".$exam);
        }
        else {
            dump("No array###".$exam);
        } */
        $model = D("FMSCommon");
       // print_r($model);
        $model->setTableName("FBase_StuInfo");
        $data["WeiXin"] = "111";
        $res = $model->where($data)->find();
        print_r($res);
    }
    
    function hiddenTel($tel){
        $tel = I("tel");
        $hidden_tel = substr($tel,0,3).'***'.substr($tel,-4);
        return $hidden_tel;
    }
    
    public function hztest(){
        $this->display("mylist");
    }
}
